<template>
  <el-menu
      :default-active="activeIndex"
      class="el-menu-vertical-demo"
      background-color="#00162a"
      text-color="#fff"
      active-text-color="#1891fd"
      router>
    <el-menu-item index="home">
      <template slot="title">
        <i class="el-icon-house"></i>
        <span>首页</span>
      </template>
    </el-menu-item>
    <el-submenu index="userBar" v-permission="['SuperAdmin','Admin']">
      <template slot="title">
        <i class="el-icon-s-cooperation"></i>
        <span>用户管理</span>
      </template>
      <el-menu-item index="user">
        <i class="el-icon-s-custom"></i>
        <span>学生用户</span>
      </el-menu-item>
      <el-menu-item index="admin" v-permission="['SuperAdmin']">
        <i class="el-icon-s-custom"></i>
        <span>管理员用户</span>
      </el-menu-item>
    </el-submenu>
    <el-menu-item index="apply">
      <i class="el-icon-edit-outline"></i>
      <span slot="title">报名管理</span>
    </el-menu-item>
    <el-submenu index="contest">
      <template slot="title">
        <i class="el-icon-takeaway-box"></i>
        <span slot="title">竞赛管理</span>
      </template>
      <el-menu-item index="Team">
        <i class="el-icon-ship"></i>
        <span>参赛队伍</span>
      </el-menu-item>
      <el-menu-item index="work">
        <i class="el-icon-trophy"></i>
        <span>竞赛作品</span>
      </el-menu-item>
      <el-menu-item index="contestPush">
        <i class="el-icon-position"></i>
        <span> 竞赛发布</span>
      </el-menu-item>
      <el-menu-item index="appraise" v-permission="['appraise']">
        <i class="el-icon-edit"></i>
        <span>竞赛评审</span>
      </el-menu-item>
      <el-menu-item index="Wonderful">
        <i class="el-icon-s-marketing"></i>
        <span>竞赛风采</span>
      </el-menu-item>
    </el-submenu>
    <el-menu-item index="Notice">
      <i class="el-icon-info"></i>
      <span slot="title">公告管理</span>
    </el-menu-item>
  </el-menu>
</template>

<script>
export default {
  name: "leftMenu",
  data() {
    return {
      activeIndex: this.$route.path.slice(1) === '' ? 'home' : this.$route.path.slice(1)
    }
  },
  mounted() {

  }
}
</script>

<style scoped>
.el-menu {
  width: 200px;
  height: 100vh;
}
</style>